package com.haiyou.common.form;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;


/**
 * 验证码表单
 */
@Data
@ApiModel(value = "验证码表单")
public class ValidCodeForm {

    @ApiModelProperty(value = "手机号")
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号不正确")
    private String phone;

    @ApiModelProperty(value = "验证码类型，1:登陆,2:忘记密码,3:注册,4:通用")
    @NotNull(message = "验证码类型不能为空")
    @Range(min = 1, max = 4, message = "验证码类型参数错误")
    private Integer type;

}
